package com.aaa.ss.controller;

import com.aaa.common.entity.Order;
import com.aaa.ss.entity.TbNews;
import com.aaa.ss.service.TbNewsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (TbNews)表控制层
 *
 * @author makejava
 * @since 2020-11-05 14:56:01
 */
@RestController
@RequestMapping("tbNews")
public class TbNewsController {
    /**
     * 服务对象
     */
    @Resource
    private TbNewsService tbNewsService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Map selectOne(Integer id) {
        return this.tbNewsService.queryById(id);
    }

    @RequestMapping("queryOrderList")
    public List<Order> queryOrderList(){
        return tbNewsService.queryOrderList();
    }

}